package com.sora.pipeline.domain.dto;

import jakarta.validation.constraints.*;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * 线路创建/更新请求DTO
 * 
 * @author system
 * @since 2025-01-20
 */
@Data
public class LineRequest {
    
    /**
     * 线路编号
     */
    @NotBlank(message = "线路编号不能为空")
    @Size(min = 3, max = 20, message = "线路编号长度必须在3-20字符之间")
    private String lineCode;
    
    /**
     * 线路名称
     */
    @NotBlank(message = "线路名称不能为空")
    @Size(min = 2, max = 50, message = "线路名称长度必须在2-50字符之间")
    private String lineName;
    
    /**
     * 起点
     */
    @NotBlank(message = "起点不能为空")
    private String startPoint;
    
    /**
     * 终点
     */
    @NotBlank(message = "终点不能为空")
    private String endPoint;
    
    /**
     * 线路长度(km)
     */
    @NotNull(message = "线路长度不能为空")
    @DecimalMin(value = "0.01", message = "线路长度必须大于0")
    private BigDecimal length;
    
    /**
     * 区域：east/west/south/north
     */
    @NotBlank(message = "区域不能为空")
    @Pattern(regexp = "^(east|west|south|north)$", message = "区域只能是east/west/south/north")
    private String region;
    
    /**
     * 状态：normal/maintenance/disabled
     */
    @Pattern(regexp = "^(normal|maintenance|disabled)$", message = "状态只能是normal/maintenance/disabled")
    private String status;
    
    /**
     * 描述
     */
    @Size(max = 500, message = "描述长度不能超过500字符")
    private String description;
}
